import request from '@/utils/request'

export async function getDictList(data) {
  return request({
    url: '/Dictionary/pageQuery',
    method: 'post',
    data,
  })
}

export async function doEdit(data) {
  return request({
    url: '/Dictionary/saveOrUpdate',
    method: 'post',
    data,
  })
}

export async function doDelete(id) {
  return request({
    url: '/Dictionary/deleteById?id=' + id,
    method: 'post',
    data: {},
  })
}
// 新增字典内容
export async function addDict(data) {
  return request({
    url: '/Dictionary/saveOrUpdate',
    method: 'post',
    data,
  })
}
// 批量获取字段信息
export async function getDictByKeys(keyList) {
  const param = encodeURIComponent(keyList.join(','))
  return request({
    url: `/Dictionary/getDictByKeyBatch?keyList=${param}`,
    method: 'post',
    data: {},
  })
}
